/**
 * 编辑页面公共样式
 * 统一管理所有系统模块编辑页面的样式
 */

// 编辑页面基础样式
.edit-page {
  min-height: 100vh;
  background: #f5f5f5;
  padding-bottom: 120px; // 为底部按钮留出空间
  
  // 表单内容区域
  .form-content {
    background: white;
    margin: 8px;
    border-radius: 8px;
    padding: 16px;
  }
  
  // 选择器样式
  .selector {
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: white;
    
    .selector-content {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 8px 12px;
      min-height: 36px;
      
      .selector-text {
        flex: 1;
        font-size: 14px;
        color: #333;
        
        &.placeholder {
          color: #999;
        }
      }
    }
  }
  
  // 抽屉选择器样式
  .drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }
  
  .drawer {
    background: white;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    
    .drawer-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 20px 16px 16px;
      border-bottom: 1px solid #e8e8e8;
      
      .drawer-title {
        font-size: 18px;
        font-weight: 600;
        color: #333;
      }
    }
    
    .drawer-body {
      flex: 1;
      padding: 16px;
      max-height: 400px;
      overflow-y: auto;
    }
    
    .drawer-footer {
      display: flex;
      justify-content: flex-end;
      gap: 12px;
      padding: 16px;
      border-top: 1px solid #e8e8e8;
      
      .btn {
        padding: 8px 16px;
        border-radius: 6px;
        font-size: 13px;
        border: none;
        cursor: pointer;
        min-width: 60px;
        height: 32px;
        line-height: 16px;
        
        &.btn-cancel {
          background: #f5f5f5;
          color: #666;
        }
        
        &.btn-confirm {
          background: #1890ff;
          color: white;
        }
      }
    }
  }
  
  // 底部操作按钮区域
  .footer-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e8e8e8;
    padding: 16px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    
    .action-buttons {
      display: flex;
      justify-content: flex-end;
      gap: 12px;
      
      .cancel-btn {
        background: white;
        border: 2px solid #d9d9d9;
        color: #434343;
        padding: 12px 20px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        min-width: 100px;
        height: 44px;
        text-align: center;
        line-height: 20px;
        transition: all 0.2s ease;
        
        &:active {
          background: #f5f5f5;
          border-color: #bfbfbf;
        }
      }
      
      .submit-btn {
        background: #1890ff;
        color: white;
        padding: 12px 20px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        min-width: 100px;
        height: 44px;
        text-align: center;
        line-height: 20px;
        border: none;
        transition: all 0.2s ease;
        
        &:active {
          background: #096dd9;
          transform: translateY(1px);
        }
      }
    }
  }
  
  // 抽屉滑入动画
  @keyframes slideUp {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }
}

// 表单字段样式优化
.edit-page {
  // 表单项间距
  .uni-forms-item {
    margin-bottom: 16px;
    
    &:last-child {
      margin-bottom: 0;
    }
  }
  
  // 输入框样式统一
  .uni-easyinput {
    .uni-easyinput__content {
      border-radius: 6px;
      border: 1px solid #d9d9d9;
      
      &:focus-within {
        border-color: #1890ff;
        box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
      }
    }
  }
  
  // 数字输入框样式
  .uni-number-box {
    .uni-number-box__value {
      border-radius: 6px;
      border: 1px solid #d9d9d9;
    }
  }
  
  // 下拉选择框样式
  .uni-data-select {
    .uni-select {
      border-radius: 6px;
      border: 1px solid #d9d9d9;
      
      &:focus-within {
        border-color: #1890ff;
        box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
      }
    }
  }
  
  // 日期时间选择器样式
  .uni-datetime-picker {
    .uni-date {
      border-radius: 6px;
      border: 1px solid #d9d9d9;
      
      &:focus-within {
        border-color: #1890ff;
        box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
      }
    }
  }
  
  // 复选框和单选框样式
  .uni-data-checkbox {
    .uni-data-checklist {
      .checklist-group {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
        
        .checklist-box {
          border-radius: 4px;
          border: 1px solid #d9d9d9;
          margin-right: 0;
          
          &.is--checked {
            border-color: #1890ff;
            background-color: #1890ff;
          }
        }
        
        .checklist-text {
          margin-left: 4px;
        }
      }
    }
  }
  
  // 单选框样式优化
  .uni-data-radio {
    .uni-data-checklist {
      .checklist-group {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
        
        .checklist-box {
          border-radius: 50%;
          border: 1px solid #d9d9d9;
          margin-right: 0;
          
          &.is--checked {
            border-color: #1890ff;
            background-color: #1890ff;
          }
        }
        
        .checklist-text {
          margin-left: 4px;
        }
      }
    }
  }
  
  // 通用单选框和复选框容器样式
  .uni-data-checklist {
    .checklist-group {
      display: flex !important;
      flex-direction: row !important;
      flex-wrap: wrap !important;
      gap: 16px !important;
      
      .checklist-item {
        display: flex;
        align-items: center;
        margin-bottom: 0;
        margin-right: 16px;
        
        &:last-child {
          margin-right: 0;
        }
      }
    }
  }
}

// 响应式设计
@media (max-width: 768px) {
  .edit-page {
    .form-content {
      margin: 4px;
      padding: 12px;
    }
    
    .footer-actions {
      padding: 12px;
      
      .action-buttons {
        gap: 8px;
        
        .cancel-btn,
        .submit-btn {
          min-width: 80px;
          padding: 10px 16px;
          font-size: 13px;
        }
      }
    }
    
    // 小屏幕下单选框和复选框的间距调整
    .uni-data-checklist {
      .checklist-group {
        gap: 12px !important;
        
        .checklist-item {
          margin-right: 12px;
        }
      }
    }
  }
} 